/**
 * Author:   .
 * Date:    2017/7/27 0027.
 * payPop
 * @param{object} param: {paySn: '', orderId: ''}
 * @param{function} closedHandle
 */
import Vue from 'vue'
const PayConstructor = Vue.extend(require('./payPop.vue'))
let instance = null
let getAnInstance = () => {
  if (!instance) {
    instance = new PayConstructor({
      el: document.createElement('div')
    })
  }
  return instance
}
let payPop = (param = {}, closedHandle = function () {}) => {
  let instance = getAnInstance()
  instance.param = param
  instance.closedHandle = closedHandle
  let app = document.getElementById('app')
  console.log(app)
  app.appendChild(instance.$el)
  Vue.nextTick(function() {
    instance.show = true
  })
  return instance
}
export default payPop
